# Pygame 绘制形状
# 通过使用pygame.draw模块中的函数，可以在游戏窗口中绘制不同的形状，如矩形、圆形、椭圆、多边形和直线。
#
# 绘制一个矩形	rect(surface, color, rect)
# 绘制一个多边形	polygon(surface, color, points)
# 绘制一个圆	圆(表面, 颜色, 中心, 半径)
# 绘制椭圆	椭圆(surface, color, rect)
# 画一个椭圆弧	arc(surface, color, rect, start_angle, stop_angle)
# 画一条直线	直线(surface, color, start_pos, end_pos, width)
import pygame

pygame.init()
screen = pygame.display.set_mode((400, 300))
done = False
red = (255,0,0)
green = (0,255,0)
blue = (0,0,255)
white = (255,255,255)
while not done:
   for event in pygame.event.get():
      if event.type == pygame.QUIT:
         done = True
   # pygame.draw.rect(screen, red, pygame.Rect(100, 30, 60, 60), 1)      如果在函数中加入一个可选的整数参数，形状将以指定的颜色作为轮廓颜色被绘制。数值对应于轮廓的厚度和形状内部的背景颜色。
   # pygame.draw.circle(screen, white, (180, 180), 60, 2)
   # pygame.draw.ellipse(screen, green, (250, 200, 130, 80), 5)
   pygame.draw.rect(screen, red, pygame.Rect(100, 30, 60, 60))
   pygame.draw.polygon(screen, blue, ((25,75),(76,125),(275,200),(350,25),(60,280)))
   pygame.draw.circle(screen, white, (180,180), 60)
   pygame.draw.line(screen, red, (10,200), (300,10), 4)
   pygame.draw.ellipse(screen, green, (250, 200, 130, 80))
   pygame.display.update()